<template>
	<h3>动态组件-父组件</h3>
	<button @click="show=MyLeft">切换MyLeft</button>
	<button  @click="show=MyRight">切换MyRight</button>
	<KeepAlive exclude='MyLeft'>
		<component :is='show'></component>
	</KeepAlive>
</template>

<script setup>
	import { onMounted, shallowRef } from 'vue';
    import MyLeft from './MyLeft.vue'
	import MyRight from './MyRight.vue'
	const show=shallowRef(MyLeft)
	
	
</script>

<style scoped>
</style>